

def get_flatten_dict(d):
    ret = {}
    for k,v in d.items():
        if isinstance(v, dict):
            ret = {**ret, **get_flatten_dict(v)}
        else:
            ret[k] = v
    return ret 


a = {id:id for id in range(3)}
a[0] = {id:id for id in range(10,13)}

b = get_flatten_dict(a)
   
pass